package example1

import "fmt"

func main() {
	a := [6]int{1, 2, 3, 4, 5, 6}
	s1 := a[0:3]
	s2 := a[3:6]
	fmt.Printf("%p\n", &a)
	fmt.Printf("%p\n", &a[3])
	fmt.Printf("%p\n", s1)
	fmt.Printf("%p\n", s2)
	fmt.Println("---------------")
	s1 = append(s1, 4)
	s2 = append(s2, 7)
	fmt.Printf("%p\n", &a)
	fmt.Printf("%p\n", &a[5])
	fmt.Printf("%p\n", s1)
	fmt.Printf("%p\n", s2)
	fmt.Println("---------------")

	b := []int{2, 5, 7, 9}
	fmt.Printf("len: %d, cap: %d, %p\n", len(b), cap(b), &b)
	b = append(b, 11)
	fmt.Printf("len: %d, cap: %d, %p\n", len(b), cap(b), &b)
}
